package router

import (
	"service/app/api"

	"github.com/gin-gonic/gin"
)

func PmRouterCreate() {
	JoinRoutes(func(pubRoute, authRoute *gin.RouterGroup) {
		pmApi := api.PmApiCreate()
		pmAuthRoute := authRoute.Group("pm")
		pmAuthRoute.PUT("/:id", pmApi.PmEdit)
		pmAuthRoute.GET("", pmApi.Pm_R_list)
		pmAuthRoute.GET("page", pmApi.Pmlist_page)
		pmAuthRoute.POST("", pmApi.PmCreate)
		pmAuthRoute.POST("/list", pmApi.PmAddList)
		pmAuthRoute.PUT("/role/:id", pmApi.PmAcRoles)
		pmAuthRoute.POST("/exites", pmApi.PmSqlExits)
		pmAuthRoute.DELETE("/:id", pmApi.Pm_del)
		/** 从pm.url[] 关联角色*/
		pmAuthRoute.PUT("/urlrelrole/:id", pmApi.PmUrlRelRole)
		/** 旧端口,用户列表*/
		pmAuthRoute.GET("/auth", pmApi.PmAuthList_old)
		// pmAuthRoute.GET("/list", pmApi.PmListAll_old)
	})
}
